package chp03;

public class Test7 {

    public static void main(String[] args) {
        //逻辑运算符
        System.out.println("并且(&&),只有两个条件都为真时，结果才为真");
        System.out.print("true && true: ");
        System.out.println(true && true);
        System.out.print("true && false: ");
        System.out.println(true && false);
        System.out.print("false && false: ");
        System.out.println(false && false);

        System.out.println("或者(||),只要右一个条件都为真时，结果就为真");
        System.out.print("true || true: ");
        System.out.println(true || true);
        System.out.print("true || false: ");
        System.out.println(true || false);
        System.out.print("false || false: ");
        System.out.println(false || false);

        System.out.println("取反(!),真变假，假变真");
        System.out.print("!true: ");
        System.out.println(!true);
        System.out.print("!false: ");
        System.out.println(!false);
    }
}
